﻿namespace Digitalmes.Domain.Mes;

/// <summary>
/// 工艺 SOP 
/// </summary>
[SugarTable("proc_sop", "工艺 SOP 表")]
public class ProcSop : EntityBase
{
    /// <summary>
    /// 产品 Id
    /// </summary>
    [SugarColumn(ColumnDescription = "产品Id")]
    public long ProductId { get; set; }

    /// <summary>
    /// 产品（成品）信息
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(ProductId))]
    public MdItem? Product { get; set; }

    /// <summary>
    /// 工序 Id
    /// </summary>
    [SugarColumn(ColumnDescription = "工序Id")]
    public long ProcessId { get; set; }

    /// <summary>
    /// 工序
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(ProcessId))]
    public ProcProcess? Process { get; set; }

    /// <summary>
    /// 分类，如 操作指导书、工艺图等
    /// </summary>
    [SugarColumn(ColumnDescription = "文件分类")]
    public SopClassifyEnum Classify { get; set; }

    /// <summary>
    /// 文件路径
    /// </summary>
    [SugarColumn(ColumnDescription = "文件路径", Length = 256)]
    public string? Url { get; set; }
}
